<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Vue中的列表过渡</title>
	<script type="text/javascript" src="../js/vue.js"></script>
	<style type="text/css">
		.v-enter, .v-leave-to {
			opacity: 0;
		}
		.v-enter-active, .v-leave-active {
			transition: opacity 1s;
		}
	</style>
</head>
<body>
	<div id="app">
		<transition-group>
			<div v-for="(item, index) of list" :key="item.id">
				{{item.id}}-----{{item.title}}
			</div>
		</transition-group>
		<button @click="handleBtnClick">Change</button>
	</div>
	<script type="text/javascript">
		var count = 0;
		var vm = new Vue({
			el: '#app',
			data: {
				list:[]
			},
			methods: {
				handleBtnClick: function() {
					this.list.push({
						id: count++,
						title: 'hello vue.js'	
					})
				}
			}

		})
	</script>
</body>
</html>